#include "Configuration.hpp"
#include "CppJieba.hpp"
#include <string>
#include <map>
#include <string>

using WordSegmentation = CppJieba;/////

using std::string;
using std::map;
class WebPage
{
    friend bool operator== (const WebPage &lhs, const WebPage &rhs);
    friend bool operator< (const WebPage & lhs, const WebPage &rhs);
public:
    WebPage(Configuration* config, WordSegmentation &jieba, 
            int &docId, const string &docTitle,
            const string &docUrl, const string&docContent);

    void   reSetDocId(int docId) { _docId = docId; };//重新修改每个文章id
    void   setSimhashvalue();//设置hash值

    string summary(const vector<string>&queryWords);//未实现

    int getDocId();
    string getDoc();
    string getTitle();
    string getUrl();
    string getContent();
    map<string, int> & getWordsMap();

private:
    void processDoc(Configuration* config, WordSegmentation& jieba);
private:
    string _doc;//全文
    int _docId;
    string _docTitle;
    string _docUrl;
    string _docContent;

    string _docSummmary;//未实现，需要根据查询的词生成

    map<string, int> _wordsMap;//本网页的词频统计

    uint64_t _simhashValue;

};
